addOnCommandListener

Registers an OnCommandListener to receive all commands processed by the player.

This listener is invoked whenever a command is issued to the player, whether originated locally (e.g., via sendCommand), remotely (e.g., via sendRemoteCommand), or generated by the system (e.g., as a result of a converse call). This provides a way to observe or react to any command the player handles.

Remember to call removeOnCommandListener when the listener is no longer needed to prevent memory leaks.

Parameters

listener

The non-null OnCommandListener instance to register.

See also

Throws

if listener is null.